﻿using Hangfire;
using Microsoft.Extensions.DependencyInjection;
using Tingjian.gas.service.BackgroundJobs.Jobs.RedisListConsumer;

namespace Tingjian.gas.service.BackgroundJobs
{
    public static class gasServiceJobExtension
    {

        public static void UseRedisListConsumer(this IServiceProvider service)
        {
            var job = service.GetService<RedisListConsumerJob>();

            RecurringJob.AddOrUpdate("redis队列消费者", () => job.ExecuteAsync(), CronType.Second(1));
        }
    }
}
